﻿#region

using Frosty.Conf;
using Frosty.Helpers;

using LazyLib.ActionBar;
using LazyLib.Combat;
using LazyLib.Wow;

#endregion

namespace Frosty.Abilities
{
    public class Racials
    {
        #region Nested type: ArcaneTorrent

        public class ArcaneTorrent : PDamageAction
        {
            public BarSpell Spell;

            /// <summary>
            ///   Initializes a new instance of the <see cref = "ArcaneTorrent" /> class.
            /// </summary>
            /// <param name = "priority">The priority.</param>
            /// <param name = "spellName">Name of the spell.</param>
            public ArcaneTorrent(int priority, string spellName)
                : base(priority, spellName)
            {
                Spell = BarMapper.GetSpellByName(spellName);
            }

            /// <summary>
            ///   Gets a value indicating whether this instance is wanted.
            /// </summary>
            /// <value>
            ///   <c>true</c> if this instance is wanted; otherwise, <c>false</c>.
            /// </value>
            public override bool IsWanted
            {
                get
                {
                    if (ObjectManager.MyPlayer.Target == null)
                        return false;

                    return base.IsWanted && GetKey().IsReady && Spell.IsReady &&
                           ObjectManager.MyPlayer.Target.IsCasting;
                }
            }
        }

        #endregion

        #region Nested type: Berserking

        public class Berserking : PDamageAction
        {
            public BarSpell Spell;

            /// <summary>
            ///   Initializes a new instance of the <see cref = "Berserking" /> class.
            /// </summary>
            /// <param name = "priority">The priority.</param>
            /// <param name = "spellName">Name of the spell.</param>
            public Berserking(int priority, string spellName)
                : base(priority, spellName)
            {
                Spell = BarMapper.GetSpellByName(spellName);
            }

            /// <summary>
            ///   Gets a value indicating whether this instance is wanted.
            /// </summary>
            /// <value>
            ///   <c>true</c> if this instance is wanted; otherwise, <c>false</c>.
            /// </value>
            public override bool IsWanted
            {
                get
                {
                    if (ObjectManager.MyPlayer.Target == null)
                        return false;

                    return base.IsWanted && GetKey().IsReady && Spell.IsReady;
                }
            }
        }

        #endregion

        #region Nested type: BloodFury

        public class BloodFury : PDamageAction
        {
            public BarSpell Spell;

            /// <summary>
            ///   Initializes a new instance of the <see cref = "BloodFury" /> class.
            /// </summary>
            /// <param name = "priority">The priority.</param>
            /// <param name = "spellName">Name of the spell.</param>
            public BloodFury(int priority, string spellName)
                : base(priority, spellName)
            {
                Spell = BarMapper.GetSpellByName(spellName);
            }

            /// <summary>
            ///   Gets a value indicating whether this instance is wanted.
            /// </summary>
            /// <value>
            ///   <c>true</c> if this instance is wanted; otherwise, <c>false</c>.
            /// </value>
            public override bool IsWanted
            {
                get
                {
                    if (ObjectManager.MyPlayer.Target == null)
                        return false;

                    return base.IsWanted && GetKey().IsReady && Spell.IsReady;
                }
            }
        }

        #endregion

        #region Nested type: GiftoftheNaaru

        public class GiftoftheNaaru : PDamageAction
        {
            public BarSpell Spell;

            /// <summary>
            ///   Initializes a new instance of the <see cref = "GiftoftheNaaru" /> class.
            /// </summary>
            /// <param name = "priority">The priority.</param>
            /// <param name = "spellName">Name of the spell.</param>
            public GiftoftheNaaru(int priority, string spellName)
                : base(priority, spellName)
            {
                Spell = BarMapper.GetSpellByName(spellName);
            }

            /// <summary>
            ///   Gets a value indicating whether this instance is wanted.
            /// </summary>
            /// <value>
            ///   <c>true</c> if this instance is wanted; otherwise, <c>false</c>.
            /// </value>
            public override bool IsWanted
            {
                get
                {
                    if (ObjectManager.MyPlayer.Target == null)
                        return false;

                    return base.IsWanted && GetKey().IsReady && Spell.IsReady &&
                           ObjectManager.MyPlayer.Health < 80;
                }
            }
        }

        #endregion

        #region Nested type: WarStomp

        public class WarStomp : PDamageAction
        {
            public BarSpell Spell;

            /// <summary>
            ///   Initializes a new instance of the <see cref = "WarStomp" /> class.
            /// </summary>
            /// <param name = "priority">The priority.</param>
            /// <param name = "spellName">Name of the spell.</param>
            public WarStomp(int priority, string spellName)
                : base(priority, spellName)
            {
                Spell = BarMapper.GetSpellByName(spellName);
            }

            /// <summary>
            ///   Gets a value indicating whether this instance is wanted.
            /// </summary>
            /// <value>
            ///   <c>true</c> if this instance is wanted; otherwise, <c>false</c>.
            /// </value>
            public override bool IsWanted
            {
                get
                {
                    if (ObjectManager.MyPlayer.Target == null)
                        return false;

                    return base.IsWanted && GetKey().IsReady && Spell.IsReady &&
                           ObjectManager.MyPlayer.Target.IsCasting;
                }
            }
        }

        #endregion
    }
}